<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${package}.${moduleName}.mapper.${ClassName}Mapper">

    <resultMap id="${className}Result" type="${package}.${moduleName}.entity.${ClassName}Entity"
               extends="${package}.${moduleName}.mapper.${ClassName}Mapper.${className}BaseResult">

    </resultMap>
    <sql id="${className}Column">
        <include refid="${package}.${moduleName}.mapper.${ClassName}Mapper.${className}BaseColumn"/>
    </sql>

    <select id="getListPage" parameterType="Map" resultMap="${className}Result">
        select
            <include refid="${className}Column"/>
        from ${tableName} t
        <where>
            t.IS_USED='1'
            <#list fieldList as field>
            <if test="pd.${field.attrName} != null and pd.${field.attrName} != ''">
                and t.${field.fieldName} = <#noparse>#{</#noparse>pd.${field.attrName}<#noparse>}</#noparse>
            </if>
            </#list>
        </where>
        <if test="pd.orderBy != null and pd.orderBy != ''">
            order by <#noparse>${pd.orderBy}</#noparse>
        </if>
    </select>
</mapper>